#pragma once

#include <memory>
#include <string>

namespace rpc {

/**
 * @brief Interface descriptor
 */
class InterfaceDescriptor {
public:
  virtual ~InterfaceDescriptor() {}
  /**
   * @brief parse description
   * @param description description string
   * @return true or false
   */
  virtual auto parse(const std::string &description) -> bool = 0;
  /**
   * @brief Check whether is same interface
   * @param other Another instance
   * @return true or false
   */
  virtual auto equal(const InterfaceDescriptor &other) const -> bool = 0;
};

using InterfaceDescriptorPtr = std::shared_ptr<InterfaceDescriptor>;

/**
 * @brief InterfaceDescriptor factory
 */
class InterfaceDescriptorFactory {
public:
  virtual ~InterfaceDescriptorFactory() {}
  /**
   * @brief create a new InterfaceDescriptor instance
   * @return InterfaceDescriptor instance
   */
  virtual auto create_descriptor() -> InterfaceDescriptorPtr = 0;
};

} // namespace rpc
